package org.mebusw.remote;

import org.mebusw.lostcities.GameManager;
import org.mebusw.vo.GameTable;

public class LCPlayService extends GamePlayService {

	public int refreshGame(String playerName, int gid) {
		System.out.println("LCPlayService.refreshGame");
		return super.refreshGame(playerName, gid, GameTable.LOST_CITIES);
	}

	public boolean takeACard(String playerName, int gid, int cardToTake) {
		System.out.println("LCPlayService.takeACard");
		
		GameManager gm = new GameManager();
		gm.loadGame(gid);
		if (gm.onTakeACard(playerName, cardToTake)) {
			gm.saveGame();
			refreshAllUI(gm.getGt(), playerName, gid, "ALL");
			return true;
		} else
			return false;
	}

	public boolean playACard(String playerName, int gid, int cardToPlay, int target) {
		System.out.println("LCPlayService.playACard");
		GameManager gm = new GameManager();
		gm.loadGame(gid);
		if (gm.onPlayACard(playerName, cardToPlay, target)) {
			gm.saveGame();
			refreshAllUI(gm.getGt(), playerName, gid, "ALL");
			return true;
		} else
			return false;
	}

}
